﻿using KC.Service.Core.EFService;
using KC.DTO.Account;
using KC.DTO.Core;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;

namespace KC.Service.Account
{
    public interface IRoleService : IEFService
    {
        bool ExistsRole(string roleLoweredName);

        List<RoleDTO> GetRolesByParentRoleIds(List<string> roleIds);
        Task<List<MenuNodeSimpleDTO>> GetUserMenusByRoleIdsAsync(List<string> roleIds);
        Task<List<PermissionSimpleDTO>> GetUserPermissionsByRoleIdsAsync(List<string> roleIds);

        Task<List<RoleSimpleDTO>> GetAllSimpleRolesAsync();
        List<RoleDTO> GetAllDetailRoles();
        List<RoleDTO> GetRolesByIds(List<string> ids);
        List<RoleDTO> GetRolesWithUsersByNames(List<string> roleNames);

        PaginatedBaseDTO<RoleDTO> GetPagenatedRoleList(string displayName, int pageIndex, int pageSize, bool paging = true);
        PaginatedBaseDTO<RoleDTO> GetPagenatedRoleListPagedAgain(int pageIndex, int pageSize, List<RoleDTO> list);

        RoleDTO GetDetailRoleByRoleId(string roleId);
        RoleDTO GetRoleWithUsersByName(string roleName);

        bool CreateAspNetRole(RoleDTO role, string operatorId, string operatorName);
        bool RomoveRole(string roleId, string operatorId, string operatorName);
        bool UpdateRole(RoleDTO role, string operatorId, string operatorName);

        bool UpdatePermissionInRole(string roleId, List<int> newIds, string operatorId, string operatorName);
        bool UpdateMenuInRole(string roleId, List<int> newIds, string operatorId, string operatorName);
        bool UpdateUserInRole(string roleId, List<string> addList, List<string> delList, string operatorId, string operatorName);

    }
}
